#include <QApplication>
#include "senderui.h"
#include "fadapterthread.h"
#include "fadapter.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    SenderUI w;

    QObject::connect(FAdapter::instance(), SIGNAL(send_telemetry(const QString&, QByteArray)), &w, SLOT(slotTelemetryFromF(const QString&, QByteArray)));
    QObject::connect(FAdapter::instance(), SIGNAL(send_responce(QString)), &w, SLOT(slotMsgResponceFromF(QString)));
    QObject::connect(&w, SIGNAL(commandToF(QByteArray, QString*)), FAdapter::instance(), SLOT(slotCommandControl(QByteArray, QString*)));
    FAdapterThread fat(FAdapter::instance());
    fat.start();
    //    FAdapter::instance()->finit("192.168.1.12");

    w.show();
    
    return a.exec();
}
